package com.test.fundible.fundible_08_loan_repay;

import android.text.TextUtils;

import com.google.gson.Gson;
import com.test.fundible.R;
import com.test.fundible.fundible_01_launcher.Base_fundibleApplication;

import org.json.JSONObject;

public class RpI_fundiblenf_fundibleo {

    private static class Inner {
        private static RpI_fundiblenf_fundibleo instance = new RpI_fundiblenf_fundibleo();
    }

    private RpI_fundiblenf_fundibleo(){}

    public static RpI_fundiblenf_fundibleo getInstance(){
        return Inner.instance;
    }

    public static void parse(JSONObject objJson){
        Inner.instance = new Gson().fromJson(objJson.toString(), RpI_fundiblenf_fundibleo.class);
    }

    private String currency;
    private String days;
    private String repayProFee;
    private String amount;
    private String serviceFee;
    private String serviceVatFee;
    private String overdueDay;
    private String repayAmount;
    private String repayDate;
    private String interest;
    private String overdueAmount;
    private String remainDay;
    public String t392="";
    public String lbN7="";
    public String pKbS="";
    public String jlly="";
    public String a85E="";
    public String hAA8="";
    public String aV80="";
    public String r334="";
    public String y9x8="";
    public String pJ3G="";
    public String xJm4="";
    public String tqP2="";

    public String getCurrency_fundible() {
        if (TextUtils.isEmpty(currency)) return "";
        return currency;
    }

    public String getDays_fundible() {
        if (TextUtils.isEmpty(days)) return "";
        setT392(days);
        return days;
    }

    public String getRepayProFee_fundible() {
        if (TextUtils.isEmpty(repayProFee)) return "";
        setpJ3G(repayProFee);
        return repayProFee;
    }

    public String getAmount_fundible() {
        if (TextUtils.isEmpty(amount)) return "";
        setaV80(amount);
        return amount;
    }

    public String getServiceFee_fundible() {
        if (TextUtils.isEmpty(serviceFee)) return "";
        setJlly(serviceFee);
        return serviceFee;
    }

    public String getServiceVatFee_fundible() {
        if (TextUtils.isEmpty(serviceVatFee)) return "";
        setA85E(serviceFee);
        return serviceVatFee;
    }

    public String getOverdueDay_fundible() {
        if (TextUtils.isEmpty(overdueDay)) return "";

        setaV80(overdueAmount);

        try {
            int dayInt = Integer.parseInt(overdueDay);
            if (dayInt <= 1) return Base_fundibleApplication.getInstant().getString(R.string.day_fundible,dayInt);
            else return Base_fundibleApplication.getInstant().getString(R.string.days_fundible,dayInt);

        }catch (NumberFormatException e){
            e.printStackTrace();
            return Base_fundibleApplication.getInstant().getString(R.string.days_fundible,0);
        }
    }

    public String getRemainDay() {
        if (TextUtils.isEmpty(remainDay)) return "";

        try {
            int dayInt = Integer.parseInt(remainDay);
            if (dayInt <= 1) return Base_fundibleApplication.getInstant().getString(R.string.day_fundible,dayInt);
            else return Base_fundibleApplication.getInstant().getString(R.string.days_fundible,dayInt);

        }catch (NumberFormatException e){
            e.printStackTrace();
            return Base_fundibleApplication.getInstant().getString(R.string.days_fundible,0);
        }
    }

    public String getRepayAmount_fundible() {
        if (TextUtils.isEmpty(repayAmount)) return "";
        return repayAmount;
    }

    public String getRepayDate_fundible() {
        if (TextUtils.isEmpty(repayDate)) return "";
        return repayDate;
    }

    public String getInterest_fundible() {
        if (TextUtils.isEmpty(interest)) return "";
        return interest;
    }

    public String getOverdueAmount_fundible() {
        if (TextUtils.isEmpty(overdueAmount)) return "";
        return overdueAmount;
    }

    public boolean isOvdu_fundible(){
        try {
            return Integer.parseInt(overdueDay)>0;
        }catch (NumberFormatException e){
            e.printStackTrace();
            return false;
        }
    }

    public void setT392(String t392) {
        this.t392 = t392;
    }

    public void setLbN7(String lbN7) {
        this.lbN7 = lbN7;
    }

    public void setpKbS(String pKbS) {
        this.pKbS = pKbS;
    }

    public void setJlly(String jlly) {
        this.jlly = jlly;
    }

    public void setA85E(String a85E) {
        this.a85E = a85E;
    }

    public void sethAA8(String hAA8) {
        this.hAA8 = hAA8;
    }

    public void setaV80(String aV80) {
        this.aV80 = aV80;
    }

    public void setR334(String r334) {
        this.r334 = r334;
    }

    public void setY9x8(String y9x8) {
        this.y9x8 = y9x8;
    }

    public void setpJ3G(String pJ3G) {
        this.pJ3G = pJ3G;
    }

    public void setxJm4(String xJm4) {
        this.xJm4 = xJm4;
    }

    public void setTqP2(String tqP2) {
        this.tqP2 = tqP2;
    }


}
